#ifndef __VCOM_H
#define __VCOM_H

#include "main.h"

void vcom_init(ulong baudrate);
void vcom_enable_recv(ulong baudrate);
void vcom_enable_it(void);
void vcom_send(uchar * str);
void vcom_recv(uchar * str, volatile uchar count);
void vcom_rx_user_handler(void);

/*
typedef struct VCOM
{
    bit TI;
    bit RI;
    bit REN;
    uint tx_SBUF;
    uchar rx_SBUF;
} vcom_t;
*/

#ifdef __SDCC
void vcom_tx_it(void) interrupt 1;
void vcom_rx_trigger_it(void) interrupt 0;
void vcom_rx_it(void) interrupt 3;
#endif

#endif

